# coding: UTF-8
# Filename : 
# Company : imedia
# Author : rose
# -*-coding:utf-8 -*-


import cPickle as p

#存储对象到文件
switchlistfile = 'switch.data'
def store_data(obj):
    f = file(switchlistfile, 'w')
    p.dump(obj, f)
    f.close()
    
#获得存储文件中数据
def get_obj():
    f = file(switchlistfile)
    obj = p.load(f)
    f.close()
    return obj

shoplist = {'count':5}

store_data(shoplist)

del shoplist # remove the shoplist

obj = get_obj()
print obj['count']

